package com.yuandengta.yomall.product.fallback;

import com.yuandengta.common.exception.BizCode;
import com.yuandengta.common.utils.R;
import com.yuandengta.yomall.product.feign.SeckillFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 秒杀接口调用失败熔断处理 {@link SeckillFeignServiceFallback}
 *
 * @author Kevin
 * @email: 178676392@qq.com
 */
@Slf4j
@Component
public class SeckillFeignServiceFallback implements SeckillFeignService {
    @Override
    public R getSkuSeckillInfo(Long skuId) {
        log.info("熔断方法调用...getSkuSeckillInfo");
        return R.error(BizCode.TOO_MANY_REQUESTS.getCode(), BizCode.TOO_MANY_REQUESTS.getMessage());
    }
}
